#include"../include/cmd.h"

int mv_command(int fd, cmd_t *cmd)
{
    char* srcpathname=cmd->args[0].arg;
    char* dstpathname=cmd->args[1].arg;
    printf("srcpathname=%s\n",srcpathname);
    printf("dstpathname=%s\n",dstpathname);
    int ret=rename(srcpathname,dstpathname);
    if(ret!=0)
    {
        ret=66;   //66失败
        send(fd,&ret,4,MSG_WAITALL);
        return -1;
    }
    //发送ret值告知客户端mv成功与否
    ret=99;       //99成功
    send(fd,&ret,4,MSG_WAITALL);
    return 1;
}
